package org.sachiew;

public class App {
        public static void main(String[] args) throws Exception {
                String[] path = { "E:\\workspace\\vscode-workspace-java\\K-shell\\res\\email_1133_5451.txt",
                                "E:\\workspace\\vscode-workspace-java\\K-shell\\res\\TestData.txt",
                                "E:\\workspace\\vscode-workspace-java\\K-shell\\res\\TestDataSimple.txt",
                                "E:\\workspace\\vscode-workspace-java\\K-shell\\res\\temp.txt" };

                /**
                 * 原始数据映射
                 */
                MyDOM myDOM = new MyDOM();
                myDOM.reader(path[0]);

                // 生成网络结构容器
                MyNetworkMap myNetworkMap = new MyNetworkMap(myDOM.getRawData());
                // 映射构造网络化结构
                myNetworkMap.map();

                // 展现网络结构
                System.out.println(
                                "\n--------------------------------------------- 展现网络结构 ---------------------------------------------\n\n\n");
                myNetworkMap.displayNetwork();

                /**
                 * k-shell decompose network
                 */
                // MyKshell myKshell = new MyKshell();
                // HashMap<String, HashSet<String>> networksHashMapCopy = SerializationUtils
                // .clone(myNetworkMap.getNetworksHashMap());
                // myKshell.cluster(networksHashMapCopy);
                MyKshell myKshell = new MyKshell();
                myKshell.cluster(myNetworkMap.getNetworksHashMap());

                // 展现K-shell聚类
                System.out.println(
                                "\n\n\n--------------------------------------------- 展现K-shell聚类 ---------------------------------------------\n");
                myKshell.displayClusterStatus();

                System.out.println("Mission complete!");
        }
}